package com.mx.im.sinocab.bean;

import java.text.DateFormat;
import java.util.Date;

public class User implements java.io.Serializable {

    private Integer idUser;
    private Employ employ;
    private Usertype usertype;
    private String user;
    private String password;
    private Date expiry;
    private boolean activeSesion;
    private String date;

    public User() {

        Date dateDat;

        //idUser = new Integer(0);
        employ = new Employ();
        usertype = new Usertype();
        expiry = new Date();
        user = "";
        password = "";
        activeSesion = false;
        dateDat = new Date();
        DateFormat fullDf = DateFormat.getDateInstance(DateFormat.FULL);

        this.date = fullDf.format(dateDat);
    }

    public User(Integer idUser, Employ employ, Usertype usertype, String user, String password, Date expiry) {
        Date dateDat;

        this.idUser = idUser;
        this.employ = employ;
        this.usertype = usertype;
        this.user = user;
        this.password = password;
        this.expiry = expiry;
        activeSesion = false;
        dateDat = new Date();
        DateFormat fullDf = DateFormat.getDateInstance(DateFormat.FULL);

        this.date = fullDf.format(dateDat);
    }

    public Integer getIdUser() {
        return this.idUser;
    }

    public void setIdUser(Integer idUser) {
        this.idUser = idUser;
    }

    public Employ getEmploy() {
        return this.employ;
    }

    public void setEmploy(Employ employ) {
        this.employ = employ;
    }

    public Usertype getUsertype() {
        return this.usertype;
    }

    public void setUsertype(Usertype usertype) {
        this.usertype = usertype;
    }

    public String getUser() {
        return this.user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public String getPassword() {
        return this.password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Date getExpiry() {
        return this.expiry;
    }

    public void setExpiry(Date expiry) {
        this.expiry = expiry;
    }

    public boolean isActiveSesion() {
        return activeSesion;
    }

    public void setActiveSesion(boolean activeSesion) {
        this.activeSesion = activeSesion;
    }

    public String getDate() {
        return date;
    }
}
